#{extends 'main.html' /}

#{navigation /}

<div class="content">
	<div id="breadcrumb">
		<a href="@{Courses.index}">Courses</a> → ${course.name}
	</div>
	
	<h1>${course.name}</h1>
	Room: ${course.room} <br />
	Professor: ${course.professor} <br />
	Number of attendees: ${course.attendees.size()} <br />
	
	<ul>
		#{list items:course.getLectures(), as:'lecture'}
			<li><a href="@{Lectures.show(lecture.id)}">${lecture.date.format('MM/dd, yyyy')} - ${lecture.name}</a></li>
		#{/list}
	</ul>
	
	<h2>News</h2>
	#{if course.news}
		#{list items:course.news, as:'newsItem'}
			<span>
				${newsItem.postedAt.format('dd-MM-yyyy, hh:ss')}: <b>${newsItem.title}</b><br>
				${newsItem.content} <br>
				--- ${newsItem.postedBy.name}<br>
			</span><br>
		#{/list}
	#{/if}
</div>